package main

import (
	"io"
	"net/http"
	"os"
	"fmt"
	"strings"
)

func main()  {


	client := &http.Client{}
	req, err := http.NewRequest("GET", "http://127.0.0.1:8005/api/v1/file/download?filename=1.py",strings.NewReader("name=cjb"))
	//res, err := http.Get("http://127.0.0.1:8005/api/v1/file/download?filename=1.py",)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Username", "root")

	res, err := client.Do(req)

	defer res.Body.Close()

	fmt.Println(res.StatusCode)
	f, err := os.Create("1.py")
	if err != nil {
		panic(err)
	}
	io.Copy(f, res.Body)
}